from fastapi import FastAPI

from admins.routes import admin_router
from artifact.routes import artifact_router
from authentication.routes import auth_router
from cluster.routes import cluster_router
from envd.routes import envd_router
from juicefs.routes import juicefs_router
from serve.routes import serve_router

app = FastAPI(
    title="Fiat Backend Server",
    description="🎃 Fiat server!",
    version="1.3.0",
    contact={
        "name": "Fiat",
        "url": "https://gitee.com/fialet",
        "email": "cheng2029@foxmail.com",
    },
    license_info={
        "name": "Apache 2.0",
        "url": "https://www.apache.org/licenses/LICENSE-2.0.html",
    },
    docs_url="/documentation",
    redoc_url=None,
    root_path="/fiat"
)

# Add all routers
app.include_router(auth_router)
app.include_router(admin_router)
app.include_router(envd_router)
app.include_router(juicefs_router)
app.include_router(cluster_router)
app.include_router(artifact_router)
app.include_router(serve_router)


@app.get("/")
def root():
    return {
        "status": "Active!",
        "message": "Hello world! - from Fiat Server"
    }
